
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%--TP 2 du zeros....affichage a revoir!! --%>
 <head> 
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>personalPage</title>
   <link type="text/css" rel="stylesheet" href="inc/style.css" />
 </head>
 <body>
 
 
 
  <div id="menu">
    <fieldset>
     <legend> Dear ${pseudo}, y're WELCOME ...</legend>
      <br />
      
       
     <form action="homePageServletUrl" method="get" >
        <input type="submit" value="log out"/>
        <br /> 
     </form> 
      <p>${youHaveNewNotification}</p>  
      <a href="personalPageServlet?action=notification&pseudo=<c:out value="${pseudo}"/>">Notification</a>
        
    </fieldset> 
  </div>
  
  <p>Events Created</p>
  <br />
   <table border=1>
        <thead>
            <tr>
                <th>Event Id</th>
                 <th>Date</th>
                <th>Creator</th>
                <th>Indoor_outdoor?</th>
                <th>Description</th>
                <th>Place</th>
                <th>tempsMaxE</th>
                <th>tempsMinE</th>
                <th colspan=2>Action</th>
            </tr>
        </thead>
        <tbody>
            <c:forEach items="${events}" var="event">
                <tr>
                    <td><c:out value="${event.idevent}" /></td>
                    <td><fmt:formatDate pattern="yyyy-MMM-dd" value="${event.date}" /></td>
                    <td><c:out value="${event.eventCreator}" /></td>
                    <td><c:out value="${event.indoor_outdoor}" /></td>
                    <td><c:out value="${event.name}" /></td>
                    <td><c:out value="${event.place}" /></td>
                    <td><c:out value="${tempsMaxE[event]}" /></td>
                    <td><c:out value="${tempsMinE[event]}" /></td>
                    <td><a href="personalPageServlet?action=edit&eventid=<c:out value="${event.idevent}"/>&pseudo=<c:out value="${pseudo}"/>">Update</a></td>
                    <td><a href="personalPageServlet?action=delete&eventid=<c:out value="${event.idevent}"/>&pseudo=<c:out value="${pseudo}"/>">Delete</a></td>
                </tr>
            </c:forEach>
        </tbody>
    </table>     
    <p><a href="personalPageServlet?action=insert&pseudo=<c:out value="${pseudo}"/>">Add Event</a></p>
    
    <br />
    
    <p>Invitations accepted</p>
   <table border=1>
        <thead>
            <tr>
                <th>Event Id</th>
                 <th>Date</th>
                <th>Creator</th>
                <th>Indoor_outdoor?</th>
                <th>Description</th>
                <th>Place</th>
                <th>tempsMaxE</th>
                <th>tempsMinE</th>
                
            </tr>
        </thead>
        <tbody>
            <c:forEach items="${invitatedEvents}" var="event">
                <tr>
                    <td><c:out value="${event.idevent}" /></td>
                    <td><fmt:formatDate pattern="yyyy-MMM-dd" value="${event.date}" /></td>
                    <td><c:out value="${event.eventCreator}" /></td>
                    <td><c:out value="${event.indoor_outdoor}" /></td>
                    <td><c:out value="${event.name}" /></td>
                    <td><c:out value="${event.place}" /></td>
                    <td><c:out value="${tempsMaxI[event]}" /></td>
                    <td><c:out value="${tempsMinI[event]}" /></td>
                </tr>
            </c:forEach>
        </tbody>
    </table>
  
 </body>
</html>